var vm = new Vue({
	el:'#viewapp',
	data:{
		title: null,
		merchantInfo: {},
		selected: '',
	},
	methods: {
		getInfo: function(id){
			$.get("../merchantinfo/info/"+id, function(r){
                vm.merchantInfo = r.merchantInfo;
            });
		},
		view: function(id){
			console.log(this.$route.query.id);
		},
	}
});

$(function() {
    //获取网页参数
    (function($) {
        $.getUrlParam = function(name) {
            var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
            var r = window.location.search.substr(1).match(reg);
            if (r != null)
                return unescape(r[2]);
            return null;
        }
    })(jQuery);
    id = $.getUrlParam('id');
    vm.getInfo(id);
});